<html lang="vi">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>首页</title>


    <link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.4.0/css/font-awesome.min.css">

    <link rel="stylesheet" href="css/owlcarousel/assets/owl.carousel.min.css">
    <link rel="stylesheet" href="css/owlcarousel/assets/owl.theme.default.min.css">
    <link rel="stylesheet" type="text/css" href="css/fancybox/jquery.fancybox.min.css" media="screen">

    <!-- Bootstrap -->
    <link href="css/bootstrap/css/bootstrap.min.css" rel="stylesheet">

    <link href="https://fonts.googleapis.com/css?family=Roboto+Condensed:300,400,500,700,900|Roboto:300,400,500,700,900|Open+Sans:300,400,500,700,900&amp;subset=vietnamese"
          rel="stylesheet">
    <!-- <link href="css/non-responsive.css" rel="stylesheet" /> -->
    <link type="text/css" rel="stylesheet" href="css/css/bxslider/jquery.bxslider.css">
    <!-- animate -->
    <link type="text/css" rel="stylesheet" href="css/animate/animate.css">
    <link href="css/style.css" rel="stylesheet">


</head>

<body class="">

<script>
</script>


<div id="fb-root"></div>


<!-- Your customer chat code -->
<div class="fb-customerchat" page_id="971848322966974" theme_color="#ffc300"
     logged_in_greeting="Hi! How can we help you?" logged_out_greeting="Hi! How can we help you?">
</div>
<header>
    <div class="topbar">
        <a href="/" class="left">首页</a>
        <!--        <a href="/lien-he.html" class="right">Liên hệ</a>-->
    </div>
</header>

<section id="wrapper">


    <section id="aboutus">

        <div class="titleabout">
            <div class="container">
                <h1>越南超大型的手表购物中心</h1>
                <div class="titleabout">免費送貨沒有最低限度! !</div>
            </div>
        </div>
    </section>

    <section id="productshop">
        <div class="container">
            <div class="titleproduct">
                <h2>最新产品</h2>
            </div>

            <div class="row" id="app">

                <div v-for="product in products" class="col-xs-6">
                    <div class="infobox  bounceIn">
                        <div class="img-box">
                            <a :href="'/productInfo.html?id='+product.id+''">
                                <img :src="product.proImg" alt="Đồng hồ cơ hoàn toàn tự động lộ máy con rồng vàng"
                                     class="img-responsive">
                            </a>
                        </div>

                        <div class="title-content">
                            <a href="/dong-ho-co-tu-dong-lo-may-con-rong-vang-thuy-sy-p151.html" class="title-box">{{product.proName}}</a>
                            <div class="price-box">
                                <del>
                                    {{product.proCostPrice}}
                                </del>
                                <span>
									{{product.proPrice}}
                                </span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

</section>
　　　　 <div class='ajax_loading' style='background:#F0F0F0;height:60px;width:100%;text-align:center;line-height:60px;font-size:18px;display:none;position:fixed;bottom:0px'><img src="img/loadinfo.net.gif"> 数据加载中</div>

<!--<footer>-->
<!--    <div class="bom">-->
<!--        <p>&nbsp;</p>-->
<!--    </div>-->
<!--    <p></p>-->

<!--</footer>-->

<!--<div class="fixBox">-->
<!--    <a class="fixitem backtotop" href="#">Về phía trên</a>-->
<!--    <a class="fixitem gotobuy" href="#buy">Lập tức mua bán</a>-->
<!--</div>-->
<script src="adminy/js/vue.js"></script>
<script src="adminy/js/jquery-3.3.1.min.js"></script>
<script>
    var app = new Vue({
        el: "#app",
        data: {
            page: 1,
            limit: 10,
            products: []
        }
    })
    $.ajax({
        url: "/watchsystem/product/page",
        method: 'post',
        data: {
            "page": app.page,
            "limit": app.limit
        },
        success: function (data) {
            console.log(data)
            app.products = data.data
            console.log(app.products)
        }
    })
</script>
<script type="text/javascript">
    window.addEventListener('scroll', function() {
        if(window.pageYOffset + window.innerHeight >= document.documentElement.scrollHeight) {
            app.page++;
            $("#loading").show();
            $.ajax({
                url: "/watchsystem/product/page",
                method: 'post',
                data: {
                    "page": app.page,
                    "limit": app.limit
                },
                success: function (data) {

                    console.log(data)
                    for(pr in data.data){
                        app.products.push(pr)
                    }
                    console.log(app.products)
                }
            })


        }
    });


</script>
</body>
</html>